<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let years = +prompt('请输入年份')
      let month = +prompt('请输入月份')
      if (month === '2') {
        if (years % 400 === 0 || (years % 4 === 0 && years % 100 !== 0)) {
          alert('29天')
        } else {
          alert('28天')
        }
      } else if (month in ['4', '6', '9', '11']) {
        alert('30天')
      } else {
        alert('31天')
      }
    </script>
  </body>
</html>
